<?php
	require_once('common/connectdb.php');

	$ConnectDB = new ConnectDB();
	$qReports = "SELECT * FROM tb_reports";
	$rReports = $ConnectDB->run_query($qReports);

	if(mysql_num_rows($rReports)!=0)
	{
		echo "<code>0</code>\n<REPORTS>";
		while ($row = mysql_fetch_assoc($rReports))
		{
			echo"\n\t<REPORT>
			<REPORTID>".$row['report_id']."</REPORTID>
			<REPORTTITLE>".$row['report_title']."</REPORTTITLE>		
			<REPORTDATE>".$row['report_date']."</REPORTDATE>";
			echo"\n\t</REPORT>";
		}
		echo"\n</REPORTS>";
	} 
	else {
		echo "<code>1</code>";
	}

?>
